# procedure to calibrate fiber transmissions.
# fiber transmission calibration is done taking unmasked fiber spectra
# these spectra are taken using no masks to measure full fiber 
# throughput.  A mask could lead to errors as the mask holes will certainly
# not have all the same diameters.

# it is assumed that mask and calfib have already run.  

procedure transcal(nome, ext, lista)

char    nome         {prompt="Flat field image (unmasked)"}
char    ext          {"txt",enum="txt|fits|imh",prompt="Filetype of images"}
struct  *lista

begin

char curr_mask, sc_mask, base_mask, base2_mask

int i,j 

# iraf doesn't like we use the parameter variables within the script
# so here we make a copy of them to a new variable 
# whose name has an n added to the beginning of the name of each of them
# 
char n_nome, n_ext

n_ext = ext
n_nome = nome

base_mask = nome

if (access("ifu.lin"))
   delete("ifu.lin",verify=no)

print(n_nome//"."//n_ext,>>"ifu.lin")

# we then run lifu with the L option: note that the file ifu.conf must
# exist and be prepared by mask.cl

!lifu L

end
